home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Internet Tools 1993 July / Internet Tools.iso / RockRidge / mail / sendmail / sendmail-5.65c+IDA-1.4.4.1 / src / RCS / sendmail.h,v < prev    next >
Encoding:
Text File  |  1991-08-14  |  36.2 KB  |  1,456 lines

  1. head    5.16;
  2. branch    5.16.0;
  3. access;
  4. symbols
  5.     RELEASE:5.16.0.23
  6.     BETA:5.16.0.21
  7.     UICSO:5.16.0
  8.     VANILLA:5.16;
  9. locks; strict;
  10. comment    @ * @;
  11.  
  12.  
  13. 5.16
  14. date    90.06.20.08.39.46;    author paul;    state Exp;
  15. branches
  16.     5.16.0.1;
  17. next    ;
  18.  
  19. 5.16.0.1
  20. date    90.06.20.09.41.10;    author paul;    state Exp;
  21. branches;
  22. next    5.16.0.2;
  23.  
  24. 5.16.0.2
  25. date    90.06.25.09.21.08;    author paul;    state Exp;
  26. branches;
  27. next    5.16.0.3;
  28.  
  29. 5.16.0.3
  30. date    90.09.20.17.06.44;    author paul;    state Exp;
  31. branches;
  32. next    5.16.0.4;
  33.  
  34. 5.16.0.4
  35. date    90.09.22.18.46.35;    author paul;    state Exp;
  36. branches;
  37. next    5.16.0.5;
  38.  
  39. 5.16.0.5
  40. date    90.10.13.17.25.18;    author paul;    state Exp;
  41. branches;
  42. next    5.16.0.6;
  43.  
  44. 5.16.0.6
  45. date    90.10.15.13.49.52;    author paul;    state Exp;
  46. branches;
  47. next    5.16.0.7;
  48.  
  49. 5.16.0.7
  50. date    90.11.13.15.26.11;    author paul;    state Exp;
  51. branches;
  52. next    5.16.0.8;
  53.  
  54. 5.16.0.8
  55. date    90.11.24.17.13.10;    author paul;    state Exp;
  56. branches;
  57. next    5.16.0.9;
  58.  
  59. 5.16.0.9
  60. date    90.11.29.21.17.16;    author paul;    state Exp;
  61. branches;
  62. next    5.16.0.10;
  63.  
  64. 5.16.0.10
  65. date    90.12.13.21.29.54;    author paul;    state Exp;
  66. branches;
  67. next    5.16.0.11;
  68.  
  69. 5.16.0.11
  70. date    91.03.04.21.48.23;    author paul;    state Exp;
  71. branches;
  72. next    5.16.0.12;
  73.  
  74. 5.16.0.12
  75. date    91.03.26.18.03.19;    author paul;    state Exp;
  76. branches;
  77. next    5.16.0.13;
  78.  
  79. 5.16.0.13
  80. date    91.04.02.23.20.21;    author paul;    state Exp;
  81. branches;
  82. next    5.16.0.14;
  83.  
  84. 5.16.0.14
  85. date    91.04.05.06.33.33;    author paul;    state Exp;
  86. branches;
  87. next    5.16.0.15;
  88.  
  89. 5.16.0.15
  90. date    91.04.05.14.55.15;    author paul;    state Exp;
  91. branches;
  92. next    5.16.0.16;
  93.  
  94. 5.16.0.16
  95. date    91.05.18.03.23.51;    author paul;    state Exp;
  96. branches;
  97. next    5.16.0.17;
  98.  
  99. 5.16.0.17
  100. date    91.05.20.02.52.59;    author paul;    state Exp;
  101. branches;
  102. next    5.16.0.18;
  103.  
  104. 5.16.0.18
  105. date    91.05.22.02.30.43;    author paul;    state Exp;
  106. branches;
  107. next    5.16.0.19;
  108.  
  109. 5.16.0.19
  110. date    91.05.23.21.41.27;    author paul;    state Exp;
  111. branches;
  112. next    5.16.0.20;
  113.  
  114. 5.16.0.20
  115. date    91.05.29.05.17.07;    author paul;    state Exp;
  116. branches;
  117. next    5.16.0.21;
  118.  
  119. 5.16.0.21
  120. date    91.06.01.04.05.01;    author paul;    state Exp;
  121. branches;
  122. next    5.16.0.22;
  123.  
  124. 5.16.0.22
  125. date    91.06.05.02.20.56;    author paul;    state Exp;
  126. branches;
  127. next    5.16.0.23;
  128.  
  129. 5.16.0.23
  130. date    91.06.24.16.23.29;    author paul;    state Exp;
  131. branches;
  132. next    5.16.0.24;
  133.  
  134. 5.16.0.24
  135. date    91.08.14.18.28.19;    author paul;    state Exp;
  136. branches;
  137. next    ;
  138.  
  139.  
  140. desc
  141. @@
  142.  
  143.  
  144.  
  145. 5.16
  146. log
  147. @5.64 Berkeley release
  148. @
  149. text
  150. @/*
  151.  * Copyright (c) 1983 Eric P. Allman
  152.  * Copyright (c) 1988 Regents of the University of California.
  153.  * All rights reserved.
  154.  *
  155.  * Redistribution and use in source and binary forms are permitted provided
  156.  * that: (1) source distributions retain this entire copyright notice and
  157.  * comment, and (2) distributions including binaries display the following
  158.  * acknowledgement:  ``This product includes software developed by the
  159.  * University of California, Berkeley and its contributors'' in the
  160.  * documentation or other materials provided with the distribution and in
  161.  * all advertising materials mentioning features or use of this software.
  162.  * Neither the name of the University nor the names of its contributors may
  163.  * be used to endorse or promote products derived from this software without
  164.  * specific prior written permission.
  165.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  166.  * WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  167.  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  168.  *
  169.  *    @@(#)sendmail.h    5.16 (Berkeley) 6/1/90
  170.  */
  171.  
  172. /*
  173. **  SENDMAIL.H -- Global definitions for sendmail.
  174. */
  175.  
  176. # ifdef _DEFINE
  177. # define EXTERN
  178. # ifndef lint
  179. static char SmailSccsId[] =    "@@(#)sendmail.h    5.16        6/1/90";
  180. # endif lint
  181. # else  _DEFINE
  182. # define EXTERN extern
  183. # endif _DEFINE
  184.  
  185. # include <stdio.h>
  186. # include <ctype.h>
  187. # include <setjmp.h>
  188. # include "conf.h"
  189. # include "useful.h"
  190.  
  191. # ifdef LOG
  192. # include <sys/syslog.h>
  193. # endif LOG
  194.  
  195. # ifdef DAEMON
  196. # ifdef VMUNIX
  197. # include <sys/socket.h>
  198. # include <netinet/in.h>
  199. # endif VMUNIX
  200. # endif DAEMON
  201.  
  202.  
  203. # define PSBUFSIZE    (MAXNAME + MAXATOM)    /* size of prescan buffer */
  204.  
  205.  
  206. /*
  207. **  Data structure for bit maps.
  208. **
  209. **    Each bit in this map can be referenced by an ascii character.
  210. **    This is 128 possible bits, or 12 8-bit bytes.
  211. */
  212.  
  213. #define BITMAPBYTES    16    /* number of bytes in a bit map */
  214. #define BYTEBITS    8    /* number of bits in a byte */
  215.  
  216. /* internal macros */
  217. #define _BITWORD(bit)    (bit / (BYTEBITS * sizeof (int)))
  218. #define _BITBIT(bit)    (1 << (bit % (BYTEBITS * sizeof (int))))
  219.  
  220. typedef int    BITMAP[BITMAPBYTES / sizeof (int)];
  221.  
  222. /* test bit number N */
  223. #define bitnset(bit, map)    ((map)[_BITWORD(bit)] & _BITBIT(bit))
  224.  
  225. /* set bit number N */
  226. #define setbitn(bit, map)    (map)[_BITWORD(bit)] |= _BITBIT(bit)
  227.  
  228. /* clear bit number N */
  229. #define clrbitn(bit, map)    (map)[_BITWORD(bit)] &= ~_BITBIT(bit)
  230.  
  231. /* clear an entire bit map */
  232. #define clrbitmap(map)        bzero((char *) map, BITMAPBYTES)
  233. /*
  234. **  Address structure.
  235. **    Addresses are stored internally in this structure.
  236. */
  237.  
  238. struct address
  239. {
  240.     char        *q_paddr;    /* the printname for the address */
  241.     char        *q_user;    /* user name */
  242.     char        *q_ruser;    /* real user name, or NULL if q_user */
  243.     char        *q_host;    /* host name */
  244.     struct mailer    *q_mailer;    /* mailer to use */
  245.     u_short        q_flags;    /* status flags, see below */
  246.     short        q_uid;        /* user-id of receiver (if known) */
  247.     short        q_gid;        /* group-id of receiver (if known) */
  248.     char        *q_home;    /* home dir (local mailer only) */
  249.     char        *q_fullname;    /* full name if known */
  250.     struct address    *q_next;    /* chain */
  251.     struct address    *q_alias;    /* address this results from */
  252.     struct address    *q_tchain;    /* temporary use chain */
  253.     time_t        q_timeout;    /* timeout for this address */
  254. };
  255.  
  256. typedef struct address ADDRESS;
  257.  
  258. # define QDONTSEND    000001    /* don't send to this address */
  259. # define QBADADDR    000002    /* this address is verified bad */
  260. # define QGOODUID    000004    /* the q_uid q_gid fields are good */
  261. # define QPRIMARY    000010    /* set from argv */
  262. # define QQUEUEUP    000020    /* queue for later transmission */
  263. /*
  264. **  Mailer definition structure.
  265. **    Every mailer known to the system is declared in this
  266. **    structure.  It defines the pathname of the mailer, some
  267. **    flags associated with it, and the argument vector to
  268. **    pass to it.  The flags are defined in conf.c
  269. **
  270. **    The argument vector is expanded before actual use.  All
  271. **    words except the first are passed through the macro
  272. **    processor.
  273. */
  274.  
  275. struct mailer
  276. {
  277.     char    *m_name;    /* symbolic name of this mailer */
  278.     char    *m_mailer;    /* pathname of the mailer to use */
  279.     BITMAP    m_flags;    /* status flags, see below */
  280.     short    m_mno;        /* mailer number internally */
  281.     char    **m_argv;    /* template argument vector */
  282.     short    m_s_rwset;    /* rewriting set for sender addresses */
  283.     short    m_r_rwset;    /* rewriting set for recipient addresses */
  284.     char    *m_eol;        /* end of line string */
  285.     long    m_maxsize;    /* size limit on message to this mailer */
  286. };
  287.  
  288. typedef struct mailer    MAILER;
  289.  
  290. /* bits for m_flags */
  291. # define M_CANONICAL    'C'    /* make addresses canonical "u@@dom" */
  292. # define M_EXPENSIVE    'e'    /* it costs to use this mailer.... */
  293. # define M_ESCFROM    'E'    /* escape From lines to >From */
  294. # define M_FOPT        'f'    /* mailer takes picky -f flag */
  295. # define M_HST_UPPER    'h'    /* preserve host case distinction */
  296. # define M_INTERNAL    'I'    /* SMTP to another sendmail site */
  297. # define M_LOCAL    'l'    /* delivery is to this host */
  298. # define M_LIMITS    'L'    /* must enforce SMTP line limits */
  299. # define M_MUSER    'm'    /* can handle multiple users at once */
  300. # define M_NHDR        'n'    /* don't insert From line */
  301. # define M_FROMPATH    'p'    /* use reverse-path in MAIL FROM: */
  302. # define M_ROPT        'r'    /* mailer takes picky -r flag */
  303. # define M_SECURE_PORT    'R'    /* try to send on a reserved TCP port */
  304. # define M_STRIPQ    's'    /* strip quote chars from user/host */
  305. # define M_RESTR    'S'    /* must be daemon to execute */
  306. # define M_USR_UPPER    'u'    /* preserve user case distinction */
  307. # define M_UGLYUUCP    'U'    /* this wants an ugly UUCP from line */
  308. # define M_XDOT        'X'    /* use hidden-dot algorithm */
  309.  
  310. EXTERN MAILER    *Mailer[MAXMAILERS+1];
  311.  
  312. EXTERN MAILER    *LocalMailer;        /* ptr to local mailer */
  313. EXTERN MAILER    *ProgMailer;        /* ptr to program mailer */
  314. /*
  315. **  Header structure.
  316. **    This structure is used internally to store header items.
  317. */
  318.  
  319. struct header
  320. {
  321.     char        *h_field;    /* the name of the field */
  322.     char        *h_value;    /* the value of that field */
  323.     struct header    *h_link;    /* the next header */
  324.     u_short        h_flags;    /* status bits, see below */
  325.     BITMAP        h_mflags;    /* m_flags bits needed */
  326. };
  327.  
  328. typedef struct header    HDR;
  329.  
  330. /*
  331. **  Header information structure.
  332. **    Defined in conf.c, this struct declares the header fields
  333. **    that have some magic meaning.
  334. */
  335.  
  336. struct hdrinfo
  337. {
  338.     char    *hi_field;    /* the name of the field */
  339.     u_short    hi_flags;    /* status bits, see below */
  340. };
  341.  
  342. extern struct hdrinfo    HdrInfo[];
  343.  
  344. /* bits for h_flags and hi_flags */
  345. # define H_EOH        00001    /* this field terminates header */
  346. # define H_RCPT        00002    /* contains recipient addresses */
  347. # define H_DEFAULT    00004    /* if another value is found, drop this */
  348. # define H_RESENT    00010    /* this address is a "Resent-..." address */
  349. # define H_CHECK    00020    /* check h_mflags against m_flags */
  350. # define H_ACHECK    00040    /* ditto, but always (not just default) */
  351. # define H_FORCE    00100    /* force this field, even if default */
  352. # define H_TRACE    00200    /* this field contains trace information */
  353. # define H_FROM        00400    /* this is a from-type field */
  354. # define H_VALID    01000    /* this field has a validated value */
  355. /*
  356. **  Envelope structure.
  357. **    This structure defines the message itself.  There is usually
  358. **    only one of these -- for the message that we originally read
  359. **    and which is our primary interest -- but other envelopes can
  360. **    be generated during processing.  For example, error messages
  361. **    will have their own envelope.
  362. */
  363.  
  364. struct envelope
  365. {
  366.     HDR        *e_header;    /* head of header list */
  367.     long        e_msgpriority;    /* adjusted priority of this message */
  368.     time_t        e_ctime;    /* time message appeared in the queue */
  369.     char        *e_to;        /* the target person */
  370.     char        *e_receiptto;    /* return receipt address */
  371.     ADDRESS        e_from;        /* the person it is from */
  372.     char        **e_fromdomain;    /* the domain part of the sender */
  373.     ADDRESS        *e_sendqueue;    /* list of message recipients */
  374.     ADDRESS        *e_errorqueue;    /* the queue for error responses */
  375.     long        e_msgsize;    /* size of the message in bytes */
  376.     int        e_nrcpts;    /* number of recipients */
  377.     short        e_class;    /* msg class (priority, junk, etc.) */
  378.     short        e_flags;    /* flags, see below */
  379.     short        e_hopcount;    /* number of times processed */
  380.     int        (*e_puthdr)();    /* function to put header of message */
  381.     int        (*e_putbody)();    /* function to put body of message */
  382.     struct envelope    *e_parent;    /* the message this one encloses */
  383.     struct envelope *e_sibling;    /* the next envelope of interest */
  384.     char        *e_df;        /* location of temp file */
  385.     FILE        *e_dfp;        /* temporary file */
  386.     char        *e_id;        /* code for this entry in queue */
  387.     FILE        *e_xfp;        /* transcript file */
  388.     char        *e_message;    /* error message */
  389.     char        *e_macro[128];    /* macro definitions */
  390. };
  391.  
  392. typedef struct envelope    ENVELOPE;
  393.  
  394. /* values for e_flags */
  395. #define EF_OLDSTYLE    000001        /* use spaces (not commas) in hdrs */
  396. #define EF_INQUEUE    000002        /* this message is fully queued */
  397. #define EF_TIMEOUT    000004        /* this message is too old */
  398. #define EF_CLRQUEUE    000010        /* disk copy is no longer needed */
  399. #define EF_SENDRECEIPT    000020        /* send a return receipt */
  400. #define EF_FATALERRS    000040        /* fatal errors occured */
  401. #define EF_KEEPQUEUE    000100        /* keep queue files always */
  402. #define EF_RESPONSE    000200        /* this is an error or return receipt */
  403. #define EF_RESENT    000400        /* this message is being forwarded */
  404.  
  405. EXTERN ENVELOPE    *CurEnv;    /* envelope currently being processed */
  406. /*
  407. **  Message priority classes.
  408. **
  409. **    The message class is read directly from the Priority: header
  410. **    field in the message.
  411. **
  412. **    CurEnv->e_msgpriority is the number of bytes in the message plus
  413. **    the creation time (so that jobs ``tend'' to be ordered correctly),
  414. **    adjusted by the message class, the number of recipients, and the
  415. **    amount of time the message has been sitting around.  This number
  416. **    is used to order the queue.  Higher values mean LOWER priority.
  417. **
  418. **    Each priority class point is worth WkClassFact priority points;
  419. **    each recipient is worth WkRecipFact priority points.  Each time
  420. **    we reprocess a message the priority is adjusted by WkTimeFact.
  421. **    WkTimeFact should normally decrease the priority so that jobs
  422. **    that have historically failed will be run later; thanks go to
  423. **    Jay Lepreau at Utah for pointing out the error in my thinking.
  424. **
  425. **    The "class" is this number, unadjusted by the age or size of
  426. **    this message.  Classes with negative representations will have
  427. **    error messages thrown away if they are not local.
  428. */
  429.  
  430. struct priority
  431. {
  432.     char    *pri_name;    /* external name of priority */
  433.     int    pri_val;    /* internal value for same */
  434. };
  435.  
  436. EXTERN struct priority    Priorities[MAXPRIORITIES];
  437. EXTERN int        NumPriorities;    /* pointer into Priorities */
  438. /*
  439. **  Rewrite rules.
  440. */
  441.  
  442. struct rewrite
  443. {
  444.     char    **r_lhs;    /* pattern match */
  445.     char    **r_rhs;    /* substitution value */
  446.     struct rewrite    *r_next;/* next in chain */
  447. };
  448.  
  449. EXTERN struct rewrite    *RewriteRules[MAXRWSETS];
  450.  
  451. /*
  452. **  Special characters in rewriting rules.
  453. **    These are used internally only.
  454. **    The COND* rules are actually used in macros rather than in
  455. **        rewriting rules, but are given here because they
  456. **        cannot conflict.
  457. */
  458.  
  459. /* left hand side items */
  460. # define MATCHZANY    '\020'    /* match zero or more tokens */
  461. # define MATCHANY    '\021'    /* match one or more tokens */
  462. # define MATCHONE    '\022'    /* match exactly one token */
  463. # define MATCHCLASS    '\023'    /* match one token in a class */
  464. # define MATCHNCLASS    '\024'    /* match anything not in class */
  465. # define MATCHREPL    '\025'    /* replacement on RHS for above */
  466.  
  467. /* right hand side items */
  468. # define CANONNET    '\026'    /* canonical net, next token */
  469. # define CANONHOST    '\027'    /* canonical host, next token */
  470. # define CANONUSER    '\030'    /* canonical user, next N tokens */
  471. # define CALLSUBR    '\031'    /* call another rewriting set */
  472.  
  473. /* conditionals in macros */
  474. # define CONDIF        '\032'    /* conditional if-then */
  475. # define CONDELSE    '\033'    /* conditional else */
  476. # define CONDFI        '\034'    /* conditional fi */
  477.  
  478. /* bracket characters for host name lookup */
  479. # define HOSTBEGIN    '\035'    /* hostname lookup begin */
  480. # define HOSTEND    '\036'    /* hostname lookup end */
  481.  
  482. /* \001 is also reserved as the macro expansion character */
  483. /*
  484. **  Information about hosts that we have looked up recently.
  485. **
  486. **    This stuff is 4.2/3bsd specific.
  487. */
  488.  
  489. # ifdef DAEMON
  490. # ifdef VMUNIX
  491.  
  492. # define HOSTINFO    struct hostinfo
  493.  
  494. HOSTINFO
  495. {
  496.     char        *ho_name;    /* name of this host */
  497.     struct in_addr    ho_inaddr;    /* internet address */
  498.     short        ho_flags;    /* flag bits, see below */
  499.     short        ho_errno;    /* error number on last connection */
  500.     short        ho_exitstat;    /* exit status from last connection */
  501. };
  502.  
  503.  
  504. /* flag bits */
  505. #define HOF_VALID    00001        /* this entry is valid */
  506.  
  507. # endif VMUNIX
  508. # endif DAEMON
  509. /*
  510. **  Symbol table definitions
  511. */
  512.  
  513. struct symtab
  514. {
  515.     char        *s_name;    /* name to be entered */
  516.     char        s_type;        /* general type (see below) */
  517.     struct symtab    *s_next;    /* pointer to next in chain */
  518.     union
  519.     {
  520.         BITMAP        sv_class;    /* bit-map of word classes */
  521.         ADDRESS        *sv_addr;    /* pointer to address header */
  522.         MAILER        *sv_mailer;    /* pointer to mailer */
  523.         char        *sv_alias;    /* alias */
  524. # ifdef HOSTINFO
  525.         HOSTINFO    sv_host;    /* host information */
  526. # endif HOSTINFO
  527.     }    s_value;
  528. };
  529.  
  530. typedef struct symtab    STAB;
  531.  
  532. /* symbol types */
  533. # define ST_UNDEF    0    /* undefined type */
  534. # define ST_CLASS    1    /* class map */
  535. # define ST_ADDRESS    2    /* an address in parsed format */
  536. # define ST_MAILER    3    /* a mailer header */
  537. # define ST_ALIAS    4    /* an alias */
  538. # define ST_HOST    5    /* host information */
  539.  
  540. # define s_class    s_value.sv_class
  541. # define s_address    s_value.sv_addr
  542. # define s_mailer    s_value.sv_mailer
  543. # define s_alias    s_value.sv_alias
  544. # define s_host        s_value.sv_host
  545.  
  546. extern STAB    *stab();
  547.  
  548. /* opcodes to stab */
  549. # define ST_FIND    0    /* find entry */
  550. # define ST_ENTER    1    /* enter if not there */
  551. /*
  552. **  STRUCT EVENT -- event queue.
  553. **
  554. **    Maintained in sorted order.
  555. **
  556. **    We store the pid of the process that set this event to insure
  557. **    that when we fork we will not take events intended for the parent.
  558. */
  559.  
  560. struct event
  561. {
  562.     time_t        ev_time;    /* time of the function call */
  563.     int        (*ev_func)();    /* function to call */
  564.     int        ev_arg;        /* argument to ev_func */
  565.     int        ev_pid;        /* pid that set this event */
  566.     struct event    *ev_link;    /* link to next item */
  567. };
  568.  
  569. typedef struct event    EVENT;
  570.  
  571. EXTERN EVENT    *EventQueue;        /* head of event queue */
  572. /*
  573. **  Operation, send, and error modes
  574. **
  575. **    The operation mode describes the basic operation of sendmail.
  576. **    This can be set from the command line, and is "send mail" by
  577. **    default.
  578. **
  579. **    The send mode tells how to send mail.  It can be set in the
  580. **    configuration file.  It's setting determines how quickly the
  581. **    mail will be delivered versus the load on your system.  If the
  582. **    -v (verbose) flag is given, it will be forced to SM_DELIVER
  583. **    mode.
  584. **
  585. **    The error mode tells how to return errors.
  586. */
  587.  
  588. EXTERN char    OpMode;        /* operation mode, see below */
  589.  
  590. #define MD_DELIVER    'm'        /* be a mail sender */
  591. #define MD_ARPAFTP    'a'        /* old-style arpanet protocols */
  592. #define MD_SMTP        's'        /* run SMTP on standard input */
  593. #define MD_DAEMON    'd'        /* run as a daemon */
  594. #define MD_VERIFY    'v'        /* verify: don't collect or deliver */
  595. #define MD_TEST        't'        /* test mode: resolve addrs only */
  596. #define MD_INITALIAS    'i'        /* initialize alias database */
  597. #define MD_PRINT    'p'        /* print the queue */
  598. #define MD_FREEZE    'z'        /* freeze the configuration file */
  599.  
  600.  
  601. EXTERN char    SendMode;    /* send mode, see below */
  602.  
  603. #define SM_DELIVER    'i'        /* interactive delivery */
  604. #define SM_QUICKD    'j'        /* deliver w/o queueing */
  605. #define SM_FORK        'b'        /* deliver in background */
  606. #define SM_QUEUE    'q'        /* queue, don't deliver */
  607. #define SM_VERIFY    'v'        /* verify only (used internally) */
  608.  
  609. /* used only as a parameter to sendall */
  610. #define SM_DEFAULT    '\0'        /* unspecified, use SendMode */
  611.  
  612.  
  613. EXTERN char    ErrorMode;    /* error mode, see below */
  614.  
  615. #define EM_PRINT    'p'        /* print errors */
  616. #define EM_MAIL        'm'        /* mail back errors */
  617. #define EM_WRITE    'w'        /* write back errors */
  618. #define EM_BERKNET    'e'        /* special berknet processing */
  619. #define EM_QUIET    'q'        /* don't print messages (stat only) */
  620.  
  621. /* offset used to issure that the error messages for name server error
  622.  * codes are unique.
  623.  */
  624. #define    MAX_ERRNO    100
  625. /*
  626. **  Global variables.
  627. */
  628.  
  629. EXTERN bool    FromFlag;    /* if set, "From" person is explicit */
  630. EXTERN bool    NoAlias;    /* if set, don't do any aliasing */
  631. EXTERN bool    ForceMail;    /* if set, mail even if already got a copy */
  632. EXTERN bool    MeToo;        /* send to the sender also */
  633. EXTERN bool    IgnrDot;    /* don't let dot end messages */
  634. EXTERN bool    SaveFrom;    /* save leading "From" lines */
  635. EXTERN bool    Verbose;    /* set if blow-by-blow desired */
  636. EXTERN bool    GrabTo;        /* if set, get recipients from msg */
  637. EXTERN bool    NoReturn;    /* don't return letter to sender */
  638. EXTERN bool    SuprErrs;    /* set if we are suppressing errors */
  639. EXTERN bool    QueueRun;    /* currently running message from the queue */
  640. EXTERN bool    HoldErrs;    /* only output errors to transcript */
  641. EXTERN bool    NoConnect;    /* don't connect to non-local mailers */
  642. EXTERN bool    SuperSafe;    /* be extra careful, even if expensive */
  643. EXTERN bool    ForkQueueRuns;    /* fork for each job when running the queue */
  644. EXTERN bool    AutoRebuild;    /* auto-rebuild the alias database as needed */
  645. EXTERN bool    CheckAliases;    /* parse addresses during newaliases */
  646. EXTERN bool    UseNameServer;    /* use internet domain name server */
  647. EXTERN int    SafeAlias;    /* minutes to wait until @@:@@ in alias file */
  648. EXTERN time_t    TimeOut;    /* time until timeout */
  649. EXTERN FILE    *InChannel;    /* input connection */
  650. EXTERN FILE    *OutChannel;    /* output connection */
  651. EXTERN int    RealUid;    /* when Daemon, real uid of caller */
  652. EXTERN int    RealGid;    /* when Daemon, real gid of caller */
  653. EXTERN int    DefUid;        /* default uid to run as */
  654. EXTERN char    *DefUser;    /* default user to run as (from DefUid) */
  655. EXTERN int    DefGid;        /* default gid to run as */
  656. EXTERN int    OldUmask;    /* umask when sendmail starts up */
  657. EXTERN int    Errors;        /* set if errors (local to single pass) */
  658. EXTERN int    ExitStat;    /* exit status code */
  659. EXTERN int    AliasLevel;    /* depth of aliasing */
  660. EXTERN int    MotherPid;    /* proc id of parent process */
  661. EXTERN int    LineNumber;    /* line number in current input */
  662. EXTERN time_t    ReadTimeout;    /* timeout on reads */
  663. EXTERN int    LogLevel;    /* level of logging to perform */
  664. EXTERN int    FileMode;    /* mode on files */
  665. EXTERN int    QueueLA;    /* load average starting forced queueing */
  666. EXTERN int    RefuseLA;    /* load average refusing connections are */
  667. EXTERN int    QueueFactor;    /* slope of queue function */
  668. EXTERN time_t    QueueIntvl;    /* intervals between running the queue */
  669. EXTERN char    *AliasFile;    /* location of alias file */
  670. EXTERN char    *HelpFile;    /* location of SMTP help file */
  671. EXTERN char    *StatFile;    /* location of statistics summary */
  672. EXTERN char    *QueueDir;    /* location of queue directory */
  673. EXTERN char    *FileName;    /* name to print on error messages */
  674. EXTERN char    *SmtpPhase;    /* current phase in SMTP processing */
  675. EXTERN char    *MyHostName;    /* name of this host for SMTP messages */
  676. EXTERN char    *RealHostName;    /* name of host we are talking to */
  677. EXTERN struct    sockaddr_in RealHostAddr;/* address of host we are talking to */
  678. EXTERN char    *CurHostName;    /* current host we are dealing with */
  679. EXTERN jmp_buf    TopFrame;    /* branch-to-top-of-loop-on-error frame */
  680. EXTERN bool    QuickAbort;    /*  .... but only if we want a quick abort */
  681. extern char    *ConfFile;    /* location of configuration file [conf.c] */
  682. extern char    *FreezeFile;    /* location of frozen memory image [conf.c] */
  683. extern char    Arpa_Info[];    /* the reply code for Arpanet info [conf.c] */
  684. extern ADDRESS    NullAddress;    /* a null (template) address [main.c] */
  685. EXTERN char    SpaceSub;    /* substitution for <lwsp> */
  686. EXTERN int    WkClassFact;    /* multiplier for message class -> priority */
  687. EXTERN int    WkRecipFact;    /* multiplier for # of recipients -> priority */
  688. EXTERN int    WkTimeFact;    /* priority offset each time this job is run */
  689. EXTERN int    CheckPointLimit;    /* deliveries before checkpointing */
  690. EXTERN int    Nmx;            /* number of MX RRs */
  691. EXTERN char    *PostMasterCopy;    /* address to get errs cc's */
  692. EXTERN char    *MxHosts[MAXMXHOSTS+1];    /* for MX RRs */
  693. EXTERN char    *TrustedUsers[MAXTRUST+1];    /* list of trusted users */
  694. EXTERN char    *UserEnviron[MAXUSERENVIRON+1];    /* saved user environment */
  695. /*
  696. **  Trace information
  697. */
  698.  
  699. /* trace vector and macros for debugging flags */
  700. EXTERN u_char    tTdvect[100];
  701. # define tTd(flag, level)    (tTdvect[flag] >= level)
  702. # define tTdlevel(flag)        (tTdvect[flag])
  703. /*
  704. **  Miscellaneous information.
  705. */
  706.  
  707. # include    <sysexits.h>
  708.  
  709.  
  710. /*
  711. **  Some in-line functions
  712. */
  713.  
  714. /* set exit status */
  715. #define setstat(s)    { \
  716.                 if (ExitStat == EX_OK || ExitStat == EX_TEMPFAIL) \
  717.                     ExitStat = s; \
  718.             }
  719.  
  720. /* make a copy of a string */
  721. #define newstr(s)    strcpy(xalloc(strlen(s) + 1), s)
  722.  
  723. #define STRUCTCOPY(s, d)    d = s
  724.  
  725.  
  726. /*
  727. **  Declarations of useful functions
  728. */
  729.  
  730. extern ADDRESS    *parseaddr();
  731. extern char    *xalloc();
  732. extern bool    sameaddr();
  733. extern FILE    *dfopen();
  734. extern EVENT    *setevent();
  735. extern char    *sfgets();
  736. extern char    *queuename();
  737. extern time_t    curtime();
  738. @
  739.  
  740.  
  741. 5.16.0.1
  742. log
  743. @IDA patches
  744. @
  745. text
  746. @a38 1
  747. # include <sysexits.h>
  748. d133 2
  749. a134 4
  750.     short    m_se_rwset;    /* rewriting ruleset for envelope senders */
  751.     short    m_sh_rwset;    /* rewriting ruleset for header senders */
  752.     short    m_re_rwset;    /* rewriting ruleset for envelope recipients */
  753.     short    m_rh_rwset;    /* rewriting ruleset for header recipient */
  754. a141 1
  755. # define M_BSMTP    'B'    /* don't wait for SMTP responses */
  756. a158 1
  757. # define M_RELATIVIZE    'V'    /* !-relativize all addresses */
  758. a255 3
  759. /* special shadowing null for e_macro's */
  760. #define MACNULL        ((char *) 1)    /* don't check parent's value */
  761.  
  762. d329 1
  763. a329 1
  764. /* bracket characters for host name & database keyed lookup */
  765. a331 2
  766. # define KEYBEGIN    '\037'    /* keyed lookup begin */
  767. # define KEYEND        '\017'    /* keyed lookup end */
  768. a332 4
  769. /* other miscellaneous */
  770. # define MACVALUE    '\016'    /* delayed macro expansion $& */
  771. # define QUOTE822    '\015'    /* quote next macro if RFC822 requires it */
  772.  
  773. a390 5
  774. /* s_host is defined is /usr/include/whatever on Suns */
  775. # ifdef s_host
  776. #  undef s_host
  777. # endif
  778.  
  779. a452 1
  780. #define MD_BSMTP    'b'        /* batched smtp mode */
  781. a476 48
  782. **  Database ([n]dbm) definitions.
  783. */
  784.  
  785. #ifdef DBM
  786.  
  787. typedef struct {
  788.     char    *dptr;
  789.     int    dsize;
  790. } DATUM;
  791.  
  792. # define DB_DIREXT    ".dir"
  793. # define DB_PAGEXT    ".pag"
  794.  
  795. # if defined(NDBM) && defined(SDBM)
  796.    BOTH_NDBM_AND_SDBM_DEFINED;
  797. # endif NDBM && SDBM
  798.  
  799. # if defined(NDBM) || defined(SDBM)
  800. #  undef DBM            /* while including ndbm.h */
  801. #  ifdef NDBM
  802. #   include <ndbm.h>        /* DBM is typedef'ed here */
  803. #  else
  804. #   include <sdbm.h>        /* DBM is typedef'ed here */
  805. # endif NDBM
  806. typedef DBM DBMFILE;        /* move typedef to DBMFILE */
  807. #  define DBM            /* and restore DBM definition */
  808. #  ifndef gould
  809. #   include <fcntl.h>        /* needed for dbm_open */
  810. #  endif gould
  811.  
  812. #  define DATUM datum        /* use the definition in ndbm.h */
  813.  
  814. struct dbm_table {
  815.   char *db_name;        /* database file name */
  816.   time_t db_mtime;        /* last modify time */
  817.   DBMFILE *db_dbm;        /* dbm file descriptor */
  818. };
  819.  
  820. #  define DB_NOSUCHFILE    ((DBMFILE *)  0) /* file could not be found */
  821. #  define DB_NOTYETOPEN    ((DBMFILE *) -1) /* file has not yet been opened */
  822.  
  823. #  define DB_ALIAS    '@@'    /* "name" of aliases database */
  824. #  define AliasFile    DbmTab[DB_ALIAS].db_name
  825. #  define AliasDbm    DbmTab[DB_ALIAS].db_dbm
  826.  
  827. # endif NDBM || SDBM
  828. #endif DBM
  829. /*
  830. a519 1
  831. #if !defined(NDBM) && !defined(SDBM)
  832. a520 1
  833. #endif !NDBM && !SDBM
  834. a542 1
  835. EXTERN bool    SplitRewriting;    /* use split envelope/header rewriting */
  836. a548 6
  837. #if defined(NDBM) || defined(SDBM)
  838. EXTERN struct dbm_table DbmTab[128];    /* keyed database table */
  839. #ifdef YP
  840. #define YPMARK    '%'            /* yellow pages indicator */
  841. #endif YP
  842. #endif NDBM || SDBM
  843. d558 3
  844. a588 12
  845.  
  846. /*
  847. **  Metamacro definitions.
  848. */
  849.  
  850. struct metamac
  851. {
  852.     char    metaname;
  853.     char    metaval;
  854. };
  855.  
  856. extern struct metamac    MetaMacros[];
  857. @
  858.  
  859.  
  860. 5.16.0.2
  861. log
  862. @Patches for HP-UX from Andy Linton <root@@comp.vuw.ac.nz>.  Thanks Andy!
  863. @
  864. text
  865. @a42 4
  866. # if defined(hpux)
  867. # include "flock.h"
  868. # endif /* hpux */
  869.  
  870. a43 3
  871. # if defined(hpux)
  872. # include <syslog.h>
  873. # else
  874. a44 1
  875. # endif /* hpux */
  876. @
  877.  
  878.  
  879. 5.16.0.3
  880. log
  881. @First revisions to support HEAD and MULT extensions to SMTP for DEC's
  882. mail11v3 program.
  883.  
  884. @
  885. text
  886. @a172 4
  887. # ifdef MAIL11V3
  888. #  define M_PREHEAD    'H'    /* preview headers */
  889. #  define M_MANYSTATUS    'M'    /* mailer returns multi-status for DATA cmd */
  890. # endif /* MAIL11V3 */
  891. a573 3
  892. # ifdef MAIL11V3
  893. EXTERN bool    SmtpManyStatus; /* receive multiple status' from DATA cmd */
  894. # endif /* MAIL11V3 */
  895. @
  896.  
  897.  
  898. 5.16.0.4
  899. log
  900. @Picked wrong value for M_MANYSTATUS.
  901. @
  902. text
  903. @d175 1
  904. a175 1
  905. #  define M_MANYSTATUS    'N'    /* mailer returns multi-status for DATA cmd */
  906. @
  907.  
  908.  
  909. 5.16.0.5
  910. log
  911. @Re-did indentation of # statements.  Test for #include "flock.h" moved to
  912. alias.c, daemon.c, and queue.c.  Protect m_flags with an #undef m_flags
  913. on HP-UX.  Added GDBM support.
  914. @
  915. text
  916. @d28 2
  917. a29 2
  918. #  define EXTERN
  919. #  ifndef lint
  920. d31 4
  921. a34 4
  922. #  endif /* lint */
  923. # else  /* !_DEFINE */
  924. #  define EXTERN extern
  925. # endif /* _DEFINE */
  926. d43 4
  927. d48 6
  928. a53 6
  929. #  if defined(hpux)
  930. #   include <syslog.h>
  931. #  else /* !hpux */
  932. #   include <sys/syslog.h>
  933. #  endif /* hpux */
  934. # endif /* LOG */
  935. d56 5
  936. a60 5
  937. #  ifdef VMUNIX
  938. #   include <sys/socket.h>
  939. #   include <netinet/in.h>
  940. #  endif /* VMUNIX */
  941. # endif /* DAEMON */
  942. a61 3
  943. # ifdef VSPRINTF
  944. #  include <varargs.h>
  945. # endif /* VSPRINTF */
  946. d70 1
  947. a70 1
  948. **    This is 128 possible bits, or 16 8-bit bytes.
  949. d80 1
  950. a80 1
  951. typedef unsigned int    BITMAP[BITMAPBYTES / sizeof (int)];
  952. a134 5
  953. /* m_flags is a #define in <include/sysmacros.h under HP-UX */
  954. #ifdef m_flags
  955. # undef m_flags
  956. #endif /* m_flags */
  957.  
  958. d367 1
  959. a367 1
  960. #  ifdef VMUNIX
  961. d369 1
  962. a369 1
  963. #   define HOSTINFO    struct hostinfo
  964. d382 1
  965. a382 1
  966. #   define HOF_VALID    00001        /* this entry is valid */
  967. d384 2
  968. a385 2
  969. #  endif /* VMUNIX */
  970. # endif /* DAEMON */
  971. d403 1
  972. a403 1
  973. # endif /* HOSTINFO */
  974. d420 1
  975. a420 1
  976. # endif /* s_host */
  977. d517 1
  978. a517 1
  979. } XDATUM;
  980. d522 3
  981. a524 3
  982. # ifdef GDBM
  983. #  define OTHERDBM
  984. # endif /* GDBM */
  985. d526 1
  986. a526 13
  987. # ifdef SDBM
  988. #  ifdef OTHERDBM
  989.     MULTIPLE_DBM_TYPES_DEFINED
  990. #  else
  991. #   define OTHERDBM
  992. #  endif /* OTHERDBM */
  993. # endif /* SDBM */
  994.  
  995. # if defined(NDBM) && defined(OTHERDBM)
  996.     MULTIPLE_DBM_TYPES_DEFINED
  997. # endif /* NDBM && OTHERDBM */
  998.  
  999. # if defined(NDBM) || defined(OTHERDBM)
  1000. a527 3
  1001. #  ifdef GDBM
  1002. #   include <ndbm.h>        /* DBM is typedef'ed here */
  1003. #  endif /* GDBM */
  1004. d530 1
  1005. a530 2
  1006. #  endif /* NDBM */
  1007. #  ifdef SDBM
  1008. d532 1
  1009. a532 1
  1010. #  endif /* SDBM */
  1011. d537 1
  1012. a537 1
  1013. #  endif /* gould */
  1014. d539 1
  1015. a539 1
  1016. # define XDATUM datum        /* use the definition in ndbm.h */
  1017. d547 2
  1018. a548 2
  1019. # define DB_NOSUCHFILE    ((DBMFILE *)  0) /* file could not be found */
  1020. # define DB_NOTYETOPEN    ((DBMFILE *) -1) /* file has not yet been opened */
  1021. d550 3
  1022. a552 3
  1023. # define DB_ALIAS    '@@'    /* "name" of aliases database */
  1024. # define AliasFile    DbmTab[DB_ALIAS].db_name
  1025. # define AliasDbm    DbmTab[DB_ALIAS].db_dbm
  1026. d554 2
  1027. a555 2
  1028. # endif /* NDBM || OTHERDBM */
  1029. #endif /* DBM */
  1030. a587 3
  1031. #if defined(__convex__) && defined(SHARE)
  1032. EXTERN int    DefShareUid;    /* default share uid to assign process to */
  1033. #endif /* __convex__ && SHARE */
  1034. d603 1
  1035. a603 1
  1036. #if !defined(NDBM) && !defined(OTHERDBM)
  1037. d605 1
  1038. a605 1
  1039. #endif /* !NDBM && !OTHERDBM */
  1040. d635 1
  1041. a635 1
  1042. #if defined(NDBM) || defined(OTHERDBM)
  1043. d637 4
  1044. a640 4
  1045. # ifdef YP
  1046. #  define YPMARK    '%'        /* yellow pages indicator */
  1047. # endif /* YP */
  1048. #endif /* NDBM || OTHERDBM */
  1049. @
  1050.  
  1051.  
  1052. 5.16.0.6
  1053. log
  1054. @Added MDBM conditionals.
  1055. @
  1056. text
  1057. @d523 2
  1058. a524 4
  1059. # ifndef MDBM
  1060. #  define DB_DIREXT    ".dir"
  1061. #  define DB_PAGEXT    ".pag"
  1062. # endif /* !MDBM */
  1063. a537 8
  1064. # ifdef MDBM
  1065. #  ifdef OTHERDBM
  1066.     MULTIPLE_DBM_TYPES_DEFINED
  1067. #  else
  1068. #   define OTHERDBM
  1069. #  endif /* OTHERDBM */
  1070. # endif /* MDBM */
  1071.  
  1072. a552 12
  1073. #  ifdef MDBM
  1074. #   include <mdbm.h>        /* DBM *not* typedef'ed here */
  1075. #   define DB_DIREXT        ".map"
  1076. #   define DB_PAGEXT        ".dat"
  1077. #   define DBM_INSERT        MDBM_INSERT
  1078. #   define DBM_REPLACE        MDBM_REPLACE
  1079. #   define dbm_open(x,y,z)    mdbm_open(x,y,z,(int *)0, (int *)0, (char *)0)
  1080. #   define dbm_close        mdbm_close
  1081. #   define dbm_fetch        mdbm_fetch
  1082. #   define dbm_store        mdbm_store
  1083. typedef    struct mdbm DBMFILE;
  1084. #  else /* !MDBM */
  1085. a553 1
  1086. #  endif /* MDBM */
  1087. @
  1088.  
  1089.  
  1090. 5.16.0.7
  1091. log
  1092. @Moved #include <sys/file.h> and test whether to #include "flock.h" for
  1093. faking flock() from several *.c files to sendmail.h.  Added # define XPG3
  1094. (X-Open portability guide 3) for those systems that support it (hpux and
  1095. DGUX for now).  From Andy Linton (andy.linton@@comp.vuw.ac.nz).
  1096. @
  1097. text
  1098. @a42 10
  1099. # include <sys/file.h>
  1100. # ifndef LOCK_EX
  1101. #  include "flock.h"
  1102. # endif /* !LOCK_EX */
  1103.  
  1104. # if defined(hpux) || defined(DGUX)
  1105. #  define XPG3           /* X-Open Portability Guide 3 */
  1106. #  include <unistd.h>
  1107. # endif /* hpux || DGUX */
  1108.  
  1109. @
  1110.  
  1111.  
  1112. 5.16.0.8
  1113. log
  1114. @Convex changes to eliminate need for -pcc.  Use <dirent.h> with XPG3.
  1115. @
  1116. text
  1117. @d48 1
  1118. a48 1
  1119. # if defined(hpux) || defined(_CONVEX_SOURCE) || defined(DGUX)
  1120. d51 1
  1121. a51 5
  1122. #  ifndef direct
  1123. #   include <dirent.h>
  1124. #   define direct dirent
  1125. #  endif /* !direct */
  1126. # endif /* hpux || _CONVEX_SOURCE || DGUX */
  1127. @
  1128.  
  1129.  
  1130. 5.16.0.9
  1131. log
  1132. @Deleted #ifdef/#define OUTPUT_PID in favor of testing whether _PATH_SENDMAILPID
  1133. is set.  sendmail.h now #include's pathnames.h instead of the other
  1134. modules.
  1135. @
  1136. text
  1137. @a39 1
  1138. # include "pathnames.h"
  1139. @
  1140.  
  1141.  
  1142. 5.16.0.10
  1143. log
  1144. @Contents of pathnames.h folded into conf.h.  See the comments there for
  1145. more details.
  1146. @
  1147. text
  1148. @d40 1
  1149. @
  1150.  
  1151.  
  1152. 5.16.0.11
  1153. log
  1154. @ANSIfied.
  1155. @
  1156. text
  1157. @a35 2
  1158. # include "conf.h"
  1159. # include "useful.h"
  1160. d40 2
  1161. d266 2
  1162. a267 2
  1163.     void        (*e_puthdr)();    /* function to put header of message */
  1164.     void        (*e_putbody)();    /* function to put body of message */
  1165. d463 1
  1166. a463 1
  1167.     void        (*ev_func)();    /* function to call */
  1168. d725 14
  1169. a749 1
  1170. # include "def.h"
  1171. @
  1172.  
  1173.  
  1174. 5.16.0.12
  1175. log
  1176. @UserEnviron made local to main.c.
  1177. @
  1178. text
  1179. @d691 1
  1180. @
  1181.  
  1182.  
  1183. 5.16.0.13
  1184. log
  1185. @Now use stdarg.h rather than varargs.h when __STDC__ is true.
  1186. @
  1187. text
  1188. @d37 1
  1189. a38 1
  1190. # include "useful.h"
  1191. d73 1
  1192. a73 5
  1193. #  if defined(__STDC__)
  1194. #   include <stdarg.h>
  1195. #  else /* !__STDC__ */
  1196. #   include <varargs.h>
  1197. #  endif /* __STDC__ */
  1198. @
  1199.  
  1200.  
  1201. 5.16.0.14
  1202. log
  1203. @Character set translation changes adapted from patches from Keld Simonsen
  1204. (keld@@dkuug.dk).
  1205. @
  1206. text
  1207. @a41 3
  1208. # ifdef BIT8
  1209. #  include "../ida/charset/charset.h"
  1210. # endif /* BIT8 */
  1211. a169 4
  1212. # ifdef BIT8
  1213.     CHARSET    *m_charset;    /* default character set */
  1214.     short    m_esc;        /* escape character */
  1215. # endif /* BIT8 */
  1216. d201 1
  1217. a203 4
  1218.  
  1219. # ifdef BIT8
  1220. EXTERN CHARSET *ascii;
  1221. # endif /* BIT8 */
  1222. @
  1223.  
  1224.  
  1225. 5.16.0.15
  1226. log
  1227. @Added RCS ID string
  1228. @
  1229. text
  1230. @a30 1
  1231. static char SmailRcsId[] =    "@@(#)$Id$";
  1232. @
  1233.  
  1234.  
  1235. 5.16.0.16
  1236. log
  1237. @Added definition of INADD_NONE if #ifndef'ed (used in deliver.c).  Have
  1238. gdbm use .pag files like other normal DBM packages.
  1239. @
  1240. text
  1241. @d30 2
  1242. a31 2
  1243. static char SmailSccsId[] =    "@@(#)sendmail.h    5.16        6/1/90    %I% local";
  1244. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.15 1991/04/05 14:55:15 paul Exp paul $";
  1245. a72 3
  1246. #   ifndef INADDR_NONE
  1247. #    define INADDR_NONE 0xffffffff
  1248. #   endif /* !INADDR_NONE */
  1249. a558 2
  1250. #  undef DB_DIREXT
  1251. #  define DB_DIREXT    ".pag"
  1252. @
  1253.  
  1254.  
  1255. 5.16.0.17
  1256. log
  1257. @Added DeclHostName for the host name offered in the SMTP HELO command.
  1258. Printed in the Received: header if it differs from the real host name.
  1259. @
  1260. text
  1261. @d31 1
  1262. a31 1
  1263. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.16 1991/05/18 03:23:51 paul Exp paul $";
  1264. a692 1
  1265. EXTERN char    *DeclHostName;    /* declared name of host we are talking to */
  1266. @
  1267.  
  1268.  
  1269. 5.16.0.18
  1270. log
  1271. @Eliminated non-#define VSPRINT as a portable vsprintf() is now included
  1272. in vprintf.c.
  1273. @
  1274. text
  1275. @d31 1
  1276. a31 1
  1277. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.17 1991/05/20 02:52:59 paul Exp paul $";
  1278. d79 7
  1279. a85 5
  1280. # if defined(__STDC__)
  1281. #  include <stdarg.h>
  1282. # else /* !__STDC__ */
  1283. #  include <varargs.h>
  1284. # endif /* __STDC__ */
  1285. @
  1286.  
  1287.  
  1288. 5.16.0.19
  1289. log
  1290. @Further changes for Interactive Systems UNIX adapted from patches
  1291. sent by Andy Linton <Andy.Linton@@comp.vuw.ac.nz>.
  1292. @
  1293. text
  1294. @d31 1
  1295. a31 1
  1296. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.18 1991/05/22 02:30:43 paul Exp paul $";
  1297. a38 10
  1298. # ifdef SYSV
  1299. #  include <signal.h>
  1300. # else /* !SYSV */
  1301. #  include <sys/signal.h>
  1302. # endif /* SYSV */
  1303. # if defined(SYSV) || defined(_AIX)
  1304. #  include <time.h>
  1305. # else /* !SYSV && !_AIX */
  1306. #  include <sys/time.h>
  1307. # endif /* SYSV || _AIX */
  1308. d46 1
  1309. d62 1
  1310. a62 1
  1311. #  if defined(hpux) || defined(ISC)
  1312. d64 1
  1313. a64 1
  1314. #  else /* !hpux && !ISC */
  1315. d66 1
  1316. a66 1
  1317. #  endif /* hpux || ISC */
  1318. d70 1
  1319. a70 1
  1320. #  if defined(VMUNIX) || defined(ISC)
  1321. d76 1
  1322. a76 1
  1323. #  endif /* VMUNIX || ISC */
  1324. @
  1325.  
  1326.  
  1327. 5.16.0.20
  1328. log
  1329. @Added support for autobuilding of dbm files (incomplete).
  1330. @
  1331. text
  1332. @d31 1
  1333. a31 1
  1334. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.19 1991/05/23 21:41:27 paul Exp paul $";
  1335. a626 4
  1336. # ifdef DBM_AUTOBUILD
  1337.   char *db_source;        /* text file to remake dbm */
  1338.   char *db_rule;        /* program path name or fscanf string */
  1339. # else /* !DBM_AUTOBUILD */
  1340. a627 1
  1341. # endif /* !DBM_AUTOBUILD */
  1342. a748 1
  1343. #define dbm_newstr(s)    strncpy(xalloc(s.dsize + 1), s.dptr, s.dsize)
  1344. @
  1345.  
  1346.  
  1347. 5.16.0.21
  1348. log
  1349. @Dropped tests for _AIX.
  1350. @
  1351. text
  1352. @d31 1
  1353. a31 1
  1354. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.20 1991/05/29 05:17:07 paul Exp paul $";
  1355. d44 1
  1356. a44 1
  1357. # if defined(SYSV) 
  1358. d46 1
  1359. a46 1
  1360. # else /* !SYSV */
  1361. d48 1
  1362. a48 1
  1363. # endif /* SYSV */
  1364. @
  1365.  
  1366.  
  1367. 5.16.0.22
  1368. log
  1369. @Fix handling of multi-line .forward files.  From Eric Wassenaar
  1370. (e07@@nikhefh.nikhef.nl)>
  1371. @
  1372. text
  1373. @d31 1
  1374. a31 1
  1375. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.21 1991/06/01 04:05:01 paul Exp paul $";
  1376. a153 1
  1377. # define QSELFREF    000040    /* self-reference in alias/forward expansion */
  1378. @
  1379.  
  1380.  
  1381. 5.16.0.23
  1382. log
  1383. @Now uses TIME_TYPE rather than time_t, added MATCHMAP/MATCHNMAP.
  1384. @
  1385. text
  1386. @d30 2
  1387. a31 2
  1388. static char SmailSccsId[] =    "@@(#)sendmail.h    5.16        6/1/90";
  1389. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.22 1991/06/05 02:20:56 paul Exp paul $";
  1390. d78 9
  1391. a86 7
  1392. # if defined(VMUNIX) || defined(ISC)
  1393. #  include <sys/socket.h>
  1394. #  include <netinet/in.h>
  1395. #  ifndef INADDR_NONE
  1396. #   define INADDR_NONE 0xffffffff
  1397. #  endif /* !INADDR_NONE */
  1398. # endif /* VMUNIX || ISC */
  1399. d144 1
  1400. a144 1
  1401.     TIME_TYPE    q_timeout;    /* timeout for this address */
  1402. d280 1
  1403. a280 1
  1404.     TIME_TYPE    e_ctime;    /* time message appeared in the queue */
  1405. a380 2
  1406. # define MATCHMAP    '\013'    /* found in dbm/map */
  1407. # define MATCHNMAP    '\014'    /* not found in dbm/map */
  1408. d488 1
  1409. a488 1
  1410.     TIME_TYPE    ev_time;    /* time of the function call */
  1411. d556 1
  1412. a556 3
  1413. #ifndef DBM
  1414. # undef DBM_AUTOBUILD /* can't autobuild w/o DBM of some type */
  1415. #else /* DBM */
  1416. d632 1
  1417. a632 1
  1418.   TIME_TYPE db_mtime;        /* last modify time */
  1419. d645 1
  1420. a645 1
  1421. #endif /* !DBM */
  1422. d672 1
  1423. a672 1
  1424. EXTERN TIME_TYPE TimeOut;    /* time until timeout */
  1425. d689 1
  1426. a689 1
  1427. EXTERN TIME_TYPE ReadTimeout;    /* timeout on reads */
  1428. d695 1
  1429. a695 1
  1430. EXTERN TIME_TYPE QueueIntvl;    /* intervals between running the queue */
  1431. @
  1432.  
  1433.  
  1434. 5.16.0.24
  1435. log
  1436. @Added support for the Berkeley hashing package ndbm replacement (HDBM).
  1437. @
  1438. text
  1439. @d31 1
  1440. a31 1
  1441. static char SmailRcsId[] =    "@@(#)$Id: sendmail.h,v 5.16.0.23 1991/06/24 16:23:29 paul Exp paul $";
  1442. a591 8
  1443. # ifdef HDBM
  1444. #  ifdef OTHERDBM
  1445.     MULTIPLE_DBM_TYPES_DEFINED
  1446. #  else
  1447. #   define OTHERDBM
  1448. #  endif /* OTHERDBM */
  1449. # endif /* HDBM */
  1450.  
  1451. a606 3
  1452. #  ifdef HDBM
  1453. #   include <ndbm.h>        /* DBM is typedef'ed here */
  1454. #  endif /* HDBM */
  1455. @
  1456.